#!/usr/bin/env bash

APPDIR=$(readlink -f $(dirname "$0"))

# Custom AppRun that ensures the AppImage doesn't dismount before olive-crashhandler exits

# Run main program
"$APPDIR/usr/bin/olive-editor" "$@"

# Wait arbitrary amount of time
sleep 5

# While olive-crashhandler exists, keep sleeping
while [[ $(ps -aux | grep olive-crashhandler | grep -v grep) ]]
do
	sleep 5
done
